<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
	String path = request.getScheme() + "://" + request.getServerName()
			+ ":" + request.getServerPort() + request.getContextPath();
%>
<!DOCTYPE html>
<html lang="en">
<head>
    <title>农场地图</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta name="apple-mobile-web-app-title" content="">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <link rel="shortcut icon" href="<%=path%>/resources/images/log.png" />
    <link rel="stylesheet" href="<%=path%>/resources/css/base.css">
    <link rel="stylesheet" href="<%=path%>/resources/css/webpc.css">
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=DI6OgImMtiTis7jYrjF4Tv8bsIh1fEIc"></script>
    <style>
        body,html,#allmap {
            width: 100%;
            height: 100%;
            overflow: hidden;
            margin: 0;
        }
        .toptitle {
            width: 100%;
            height: 50px;
            background-color: #fff;
            text-align: center;
        }
        .toptitle span {
            margin: 0 auto;
            font-size:18px;
            width:auto;
            line-height: 50px;
        }
    </style>
</head>
<body>
    <div class="toptitle">
        <span><a href="javascript:history.go(-1);"><img src="<%=path%>/resources/images/FH.png" style="width:20px;top:15px; left:5px; position: absolute;"/></a> 我来自</span>
    </div>
    <div id="allmap"></div>
    <script type="text/javascript">
        // 百度地图API功能
        var x =116.23;
        var y =39.54;
        var map = new BMap.Map("allmap", {
            mapType : BMAP_HYBRID_MAP
        });
        var point = new BMap.Point(x, y);
        map.centerAndZoom(point, 12);
        var marker = new BMap.Marker(point);
        map.addOverlay(marker);
        // 创建地址解析器实例
        var myGeo = new BMap.Geocoder();
        // 将地址解析结果显示在地图上,并调整地图视野
        myGeo.getPoint(function(point) {
            if (point) {
                map.centerAndZoom(point, 16);
                map.addOverlay(new BMap.Marker(point));
            } else {
                alert("您选择地址没有解析到结果!");
            }
        }, "北京市");

        map.addControl(new BMap.MapTypeControl()); //添加地图类型控件
    </script>
</body>
</html>